Optimal. Leaf size=261 \[ \frac {b (1-n) \cot (c+d x) (a+b \tan (c+d x))^{1+n}}{2 a^2 d}-\frac {\cot ^2(c+d x) (a+b \tan (c+d x))^{1+n}}{2 a d}-\frac {\, _2F_1\left (1,1+n;2+n;\frac {a+b \tan (c+d x)}{a-i b}\right ) (a+b \tan (c+d x))^{1+n}}{2 (a-i b) d (1+n)}-\frac {\, _2F_1\left (1,1+n;2+n;\frac {a+b \tan (c+d x)}{a+i b}\right ) (a+b \tan (c+d x))^{1+n}}{2 (a+i b) d (1+n)}+\frac {\left (2 a^2+b^2 (1-n) n\right ) \, _2F_1\left (1,1+n;2+n;1+\frac {b \tan (c+d x)}{a}\right ) (a+b \tan (c+d x))^{1+n}}{2 a^3 d (1+n)} \]
[Out]
________________________________________________________________________________________
Rubi [A]
time = 0.39, antiderivative size = 261, normalized size of antiderivative = 1.00, number of steps
used = 11, number of rules used = 9, integrand size = 21, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.429, Rules used = {3650, 3730,
3735, 12, 3620, 3618, 70, 3715, 67} \begin {gather*} \frac {b (1-n) \cot (c+d x) (a+b \tan (c+d x))^{n+1}}{2 a^2 d}+\frac {\left (2 a^2+b^2 (1-n) n\right ) (a+b \tan (c+d x))^{n+1} \, _2F_1\left (1,n+1;n+2;\frac {b \tan (c+d x)}{a}+1\right )}{2 a^3 d (n+1)}-\frac {(a+b \tan (c+d x))^{n+1} \, _2F_1\left (1,n+1;n+2;\frac {a+b \tan (c+d x)}{a-i b}\right )}{2 d (n+1) (a-i b)}-\frac {(a+b \tan (c+d x))^{n+1} \, _2F_1\left (1,n+1;n+2;\frac {a+b \tan (c+d x)}{a+i b}\right )}{2 d (n+1) (a+i b)}-\frac {\cot ^2(c+d x) (a+b \tan (c+d x))^{n+1}}{2 a d} \end {gather*}
Antiderivative was successfully verified.
[In]
[Out]
Rule 12
Rule 67
Rule 70
Rule 3618
Rule 3620
Rule 3650
Rule 3715
Rule 3730
Rule 3735
Rubi steps
\begin {align*} \int \cot ^3(c+d x) (a+b \tan (c+d x))^n \, dx &=-\frac {\cot ^2(c+d x) (a+b \tan (c+d x))^{1+n}}{2 a d}-\frac {\int \cot ^2(c+d x) (a+b \tan (c+d x))^n \left (b (1-n)+2 a \tan (c+d x)+b (1-n) \tan ^2(c+d x)\right ) \, dx}{2 a}\\ &=\frac {b (1-n) \cot (c+d x) (a+b \tan (c+d x))^{1+n}}{2 a^2 d}-\frac {\cot ^2(c+d x) (a+b \tan (c+d x))^{1+n}}{2 a d}+\frac {\int \cot (c+d x) (a+b \tan (c+d x))^n \left (-2 a^2-b^2 (1-n) n-b^2 (1-n) n \tan ^2(c+d x)\right ) \, dx}{2 a^2}\\ &=\frac {b (1-n) \cot (c+d x) (a+b \tan (c+d x))^{1+n}}{2 a^2 d}-\frac {\cot ^2(c+d x) (a+b \tan (c+d x))^{1+n}}{2 a d}+\frac {\int 2 a^2 \tan (c+d x) (a+b \tan (c+d x))^n \, dx}{2 a^2}+\frac {1}{2} \left (-2-\frac {b^2 (1-n) n}{a^2}\right ) \int \cot (c+d x) (a+b \tan (c+d x))^n \left (1+\tan ^2(c+d x)\right ) \, dx\\ &=\frac {b (1-n) \cot (c+d x) (a+b \tan (c+d x))^{1+n}}{2 a^2 d}-\frac {\cot ^2(c+d x) (a+b \tan (c+d x))^{1+n}}{2 a d}-\frac {\left (2+\frac {b^2 (1-n) n}{a^2}\right ) \text {Subst}\left (\int \frac {(a+b x)^n}{x} \, dx,x,\tan (c+d x)\right )}{2 d}+\int \tan (c+d x) (a+b \tan (c+d x))^n \, dx\\ &=\frac {b (1-n) \cot (c+d x) (a+b \tan (c+d x))^{1+n}}{2 a^2 d}-\frac {\cot ^2(c+d x) (a+b \tan (c+d x))^{1+n}}{2 a d}+\frac {\left (2+\frac {b^2 (1-n) n}{a^2}\right ) \, _2F_1\left (1,1+n;2+n;1+\frac {b \tan (c+d x)}{a}\right ) (a+b \tan (c+d x))^{1+n}}{2 a d (1+n)}+\frac {1}{2} i \int (1-i \tan (c+d x)) (a+b \tan (c+d x))^n \, dx-\frac {1}{2} i \int (1+i \tan (c+d x)) (a+b \tan (c+d x))^n \, dx\\ &=\frac {b (1-n) \cot (c+d x) (a+b \tan (c+d x))^{1+n}}{2 a^2 d}-\frac {\cot ^2(c+d x) (a+b \tan (c+d x))^{1+n}}{2 a d}+\frac {\left (2+\frac {b^2 (1-n) n}{a^2}\right ) \, _2F_1\left (1,1+n;2+n;1+\frac {b \tan (c+d x)}{a}\right ) (a+b \tan (c+d x))^{1+n}}{2 a d (1+n)}+\frac {\text {Subst}\left (\int \frac {(a-i b x)^n}{-1+x} \, dx,x,i \tan (c+d x)\right )}{2 d}+\frac {\text {Subst}\left (\int \frac {(a+i b x)^n}{-1+x} \, dx,x,-i \tan (c+d x)\right )}{2 d}\\ &=\frac {b (1-n) \cot (c+d x) (a+b \tan (c+d x))^{1+n}}{2 a^2 d}-\frac {\cot ^2(c+d x) (a+b \tan (c+d x))^{1+n}}{2 a d}-\frac {\, _2F_1\left (1,1+n;2+n;\frac {a+b \tan (c+d x)}{a-i b}\right ) (a+b \tan (c+d x))^{1+n}}{2 (a-i b) d (1+n)}-\frac {\, _2F_1\left (1,1+n;2+n;\frac {a+b \tan (c+d x)}{a+i b}\right ) (a+b \tan (c+d x))^{1+n}}{2 (a+i b) d (1+n)}+\frac {\left (2+\frac {b^2 (1-n) n}{a^2}\right ) \, _2F_1\left (1,1+n;2+n;1+\frac {b \tan (c+d x)}{a}\right ) (a+b \tan (c+d x))^{1+n}}{2 a d (1+n)}\\ \end {align*}
________________________________________________________________________________________
Mathematica [A]
time = 2.04, size = 212, normalized size = 0.81 \begin {gather*} -\frac {(b+a \cot (c+d x)) \left (a^3 (a+i b) \, _2F_1\left (1,1+n;2+n;\frac {a+b \tan (c+d x)}{a-i b}\right )+(a-i b) \left (a^3 \, _2F_1\left (1,1+n;2+n;\frac {a+b \tan (c+d x)}{a+i b}\right )+(a+i b) \left (a (1+n) \cot (c+d x) (b (-1+n)+a \cot (c+d x))+\left (-2 a^2+b^2 (-1+n) n\right ) \, _2F_1\left (1,1+n;2+n;1+\frac {b \tan (c+d x)}{a}\right )\right )\right )\right ) \tan (c+d x) (a+b \tan (c+d x))^n}{2 a^3 (a-i b) (a+i b) d (1+n)} \end {gather*}
Antiderivative was successfully verified.
[In]
[Out]
________________________________________________________________________________________
Maple [F]
time = 0.35, size = 0, normalized size = 0.00 \[\int \left (\cot ^{3}\left (d x +c \right )\right ) \left (a +b \tan \left (d x +c \right )\right )^{n}\, dx\]
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Maxima [F]
time = 0.00, size = 0, normalized size = 0.00 \begin {gather*} \text {Failed to integrate} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Fricas [F]
time = 0.00, size = 0, normalized size = 0.00 \begin {gather*} \text {could not integrate} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Sympy [F]
time = 0.00, size = 0, normalized size = 0.00 \begin {gather*} \int \left (a + b \tan {\left (c + d x \right )}\right )^{n} \cot ^{3}{\left (c + d x \right )}\, dx \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Giac [F]
time = 0.00, size = 0, normalized size = 0.00 \begin {gather*} \text {could not integrate} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Mupad [F]
time = 0.00, size = -1, normalized size = -0.00 \begin {gather*} \int {\mathrm {cot}\left (c+d\,x\right )}^3\,{\left (a+b\,\mathrm {tan}\left (c+d\,x\right )\right )}^n \,d x \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________